import { receiveChannelMessage } from "@/utils/childChanel";
import { closeSelfPage } from "./utils";
import { Channel } from "@/utils/channel";
export default defineComponent({
  props: {
    isSeller: {
      type: Boolean,
      default: false,
    },
  },
  setup(props) {
    const removeChannelListener = receiveChannelMessage((message) => {
      if (Object.keys(Channel.channelEnum).includes(message)) closeSelfPage();
    });
    onUnmounted(() => removeChannelListener());
    return () => (props.isSeller ? "Hello seller" : "Hello crm");
  },
});
